<?php
require('dbconnect.php');
session_start();
$username=$_SESSION['userName'];
$mail=$_POST['email'];
$gender=$_POST['gender'];
$birthday=$_POST['birthday'];
$phone=$_POST['phone'];
$qq=$_POST['qq'];
$weibo=$_POST['weibo'];
$address=$_POST['address'];
$occupation=$_POST['occupation'];
$address=$_POST['address'];
$blood_type=$_POST['blood_type'];



$checksql="select * from user where name='$username'";
$check_re=mysql_query($checksql,$conn);
$num=mysql_num_rows($check_re);
$sql="update user set gender='$gender',birthday='$birthday',phone='$phone',qq='$qq',mail='$mail',weibo='$weibo',address='$address',occupation='$occupation',blood_type='$blood_type' where name='$username'";
mysql_query($sql,$conn) or die("插入数据失败: ".mysql_error());
mysql_close($conn);
echo ("<script type='text/javascript'> alert('修改成功!'); location.href='index.php';</script>");

?>